﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using FluentParser.Expressions;

namespace FluentParser.Editor.Grammars
{
    public class AddNumbersGrammar : Grammar<int>
    {
        public AddNumbersGrammar()
        {
            Expr<int> parseNumber = ParseNumber.Int32;
            parseNumber.Color = Color.Red;
            var addedNumbers = parseNumber.Repeat(0, ",").Convert(x => x.Sum());

            Root = addedNumbers + EndOfText;
        }
    }

}
